package com.card.repository;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.card.entity.manager.UserScore;

/**
 * ClassName: IGiftRepository <br/>
 * Function: 礼品. <br/>
 * date: 2018年10月16日 下午7:14:14 <br/>
 * 
 * @author lishuai11
 * @version
 * @since JDK 1.8
 */
@Transactional
public interface IUserScoreRepository
		extends PagingAndSortingRepository<UserScore, Integer>, JpaSpecificationExecutor<UserScore> {

	@Query(nativeQuery = true, value = "SELECT s.* FROM user_score s WHERE s.user_id = ?3 ORDER BY s.createdtime DESC limit ?1,?2")
	List<UserScore> pageSearchByUserId(int pageNum, int pageSize, int userId);
}
